home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / QuickDraw GX / IW-Half-Dither / source / GXPrintingResTypes.r < prev    next >
Encoding:
Text File  |  1996-04-11  |  30.9 KB  |  1,029 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        GXPrintingResTypes.r
  3.  
  4.     Contains:    This file contains the resource descriptions used by
  5.                 writers of applications, printer drivers and printing
  6.                 extensions.
  7.  
  8.     Version:    Quickdraw GX 1.1 for ETO #18
  9.  
  10.     Copyright:    © 1994-1995 by Apple Computer, Inc., all rights reserved.
  11. */
  12.  
  13.  
  14. #ifndef _GXPRINTINGRESTYPES_
  15. #define _GXPRINTINGRESTYPES_
  16. //#endif
  17.  
  18. //#ifndef __GXTYPES__
  19. //#include <GXTypes.h>
  20. //#endif
  21.  
  22.  
  23. #include "GXPrintingResEquates.r"
  24.  
  25.  
  26. // -------------------------------------------------------------------------------
  27. // Resource definitions used by applications, extension and driver writers
  28. // -------------------------------------------------------------------------------
  29.  
  30. // 'cltn' - definition of a collection resource
  31.  
  32. type gxCollectionType {
  33.     longint = $$CountOf(ItemArray);
  34.     array ItemArray
  35.         {
  36.         longint;    // tag
  37.         longint;    // id
  38.             boolean        itemUnlocked            =    false,    // defined attributes bits...
  39.                         itemLocked                =    true;
  40.             boolean        itemNonPersistent        =    false,
  41.                         itemPersistent            =    true;
  42.             unsigned bitstring[14] = 0;                        // reserved attributes bits...
  43.             unsigned bitstring[16];                            // user attributes bits...
  44.         wstring;
  45.         align word;
  46.     };
  47. };
  48.  
  49.  
  50.  
  51. // -------------------------------------------------------------------------------
  52. // Resource definitions used by both extension and driver writers
  53. // -------------------------------------------------------------------------------
  54.  
  55. type gxOverrideType
  56.     {
  57.     integer = $$CountOf(OverrideArray);
  58.     array OverrideArray {
  59.         integer;                            // enabled Message ID
  60.         unsigned bitstring[4] = 0;
  61.         unsigned bitstring[12];             // dispatchResID
  62.         integer;                            //    codeOffset
  63.         longint = -1;
  64.     };
  65. };
  66.  
  67.  
  68. // -------------------------------------------------------------------------------
  69. // Resource definitions REQUIRED by extension writers
  70. // -------------------------------------------------------------------------------
  71.  
  72. type gxExtensionScopeType {
  73.     
  74.     integer = $$CountOf(ScopeArray);
  75.     
  76.     array ScopeArray {
  77.         longint;            //    scope OSType
  78.     };
  79. };
  80.  
  81. type gxExtensionLoadType {
  82.  
  83.     longint;                //    load Priority
  84. };
  85.  
  86. type gxExtensionOptimizationType {
  87.  
  88.     boolean        gxExecuteDuringImaging            =    true,
  89.                 gxDontExecuteDuringImaging        =    false;
  90.     boolean        gxNeedDeviceStatus                =    true,
  91.                 gxDontNeedDeviceStatus            =    false;
  92.     boolean        gxChangePageAtGXDespoolPage        =    true,
  93.                 gxDontChangePageAtGXDespoolPage    =    false;
  94.     boolean        gxChangePageAtGXImagePage        =    true,
  95.                 gxDontChangePageAtGXImagePage    =    false;
  96.     boolean        gxChangePageAtGXRenderPage        =    true,
  97.                 gxDontChangePageAtGXRenderPage    =    false;
  98.     boolean        gxServerPresenceRequired        =    true,
  99.                 gxNotServerPresenceRequired        =    false;
  100.     boolean        gxClientPresenceRequired        =    true,
  101.                 gxNotClientPresenceRequired        =    false;
  102.     unsigned bitstring[25] = 0;                            // reserved flags
  103. };
  104.  
  105.  
  106. // -------------------------------------------------------------------------------
  107. // Resource definitions REQUIRED by driver writers
  108. // -------------------------------------------------------------------------------
  109.  
  110. // imaging system selection
  111. type gxImagingSystemSelectorType
  112.     {
  113.     longint;        // type of imaging system to select
  114. };
  115.  
  116.  
  117. #define gxDefaultOptionsTranslation        0x0000
  118. #define gxOptimizedTranslation             0x0001
  119. #define gxReplaceLineWidthTranslation     0x0002
  120. #define gxSimpleScalingTranslation         0x0004
  121. #define gxSimpleGeometryTranslation         0x0008    /* implies simple scaling */
  122. #define gxSimpleLinesTranslation        0x000C    /* implies simple geometry & scaling */
  123. #define gxLayoutTextTranslation             0x0010    /* turn on gxLine layout (normally off) */
  124. #define gxRasterTargetTranslation        0x0020
  125. #define gxPostScriptTargetTranslation    0x0040
  126. #define gxVectorTargetTranslation        0x0080
  127.  
  128. type gxCustType
  129.     {
  130.     integer;                                         // horizontalResolution;
  131.     integer;                                         // verticalResolution;
  132.     integer     defaultUpDriver     = 0,
  133.                 laserWriter         = 0,
  134.                 laserWriterSC         = 1;            // upDriverType
  135.  
  136.     point;                                            // pattern stretch factor
  137.     integer;                                        // translator settings
  138.     };
  139.  
  140. type gxReslType
  141.     {
  142.     integer    rangeType = 1;                                 // constant;
  143.     integer;                                            //    xMinimumResolution
  144.     integer;                                            //    xMaximumResolution
  145.     
  146.     integer;                                            //    yMinimumResolution
  147.     integer;                                            //    yMaximumResolution
  148.     
  149.     integer = $$CountOf(ResolutionArray);
  150.     array        ResolutionArray
  151.         {
  152.         integer;                                        // xResolution
  153.         integer;                                        // yResolution
  154.         };
  155.     };
  156.  
  157.  
  158.  
  159. type gxPrintRecordType (3)
  160.     {
  161.     integer;                                /* count: number of paper types */
  162.     point;                                /* a paper type's bottom/left coordinate */
  163.     point;                                /* ...expressed in 120th of an inch */
  164.     point;                                /* There are always six of them */
  165.     point;
  166.     point;
  167.     point;
  168.     pstring;                                /* The paper type name */
  169.     pstring;                                /* The paper type name */
  170.     pstring;                                /* The paper type name */
  171.     pstring;                                /* The paper type name */
  172.     pstring;                                /* The paper type name */
  173.     pstring;                                /* The paper type name */
  174.     };
  175.  
  176.  
  177.  
  178. // IO RELATED RESOURCES
  179.  
  180. // the "look"er resource defines the list of things to look for - and thus the types
  181. // of communications this device will support.
  182.  
  183.  
  184. #define isAppleTalk        1            /* looker type is AppleTalk */
  185. #define iconCells        2            /* looker wants large cells w/ icons in them */
  186. #define isPrinterShare    4            /* looker is for a PrinterShare connection */
  187.  
  188. type gxLookerType (-4096) {
  189.     integer;                        // looker to select by default
  190.     integer = $$CountOf(LookerList);
  191.     array LookerList {
  192.         pstring[33];                    // name of looker - displayed to user in list
  193.         align word;
  194.         integer;                        // id of 'comm' resource for this looker;
  195.         longint noFlags = 0;            // flags for this looker
  196.         pstring[33];                    // NBP type, or default item name for non-AppleTalk
  197.     };
  198. };
  199.  
  200.  
  201. // -------------------------------------------------------------------------------
  202. // Resource definitions optional for driver writers
  203. // -------------------------------------------------------------------------------
  204. /* this resource should be included in specific drivers that wish to supply driver */
  205. /* specific output file formats for the print to file option.  The pstrings will */
  206. /* be added to the standard file dialog popup menu when the user confirms the  */
  207. /* print dialog after selecting 'Print to a file'.  The job contains a destination */
  208. /* record which is updated from this dialog.  The destination record specifies */
  209. /* whether output is to go to the printer or to disk.  If it is to go to disk */
  210. /* the format string in the record will designate the format of the file to create. */
  211. /* the format string will either be 'Print File' specifying a spool file or */
  212. /* a string the driver has provided through this resource.  */
  213.  
  214. type gxDriverFileFormatType {
  215.     integer = $$Countof(fileFormatArray);
  216.     array fileFormatArray {
  217.         pstring;                                /* what to show in menu - formatname */
  218.         };
  219.     };
  220.  
  221. type gxDestinationAdditionType {
  222.     integer = $$Countof(additionArray);
  223.     array additionArray {
  224.         pstring;                                /* what to show in menu - formatname */
  225.         pstring;                                /* change Print button to this string */
  226.         };
  227.     };
  228.  
  229. // IO RELATED RESOURCES
  230.  
  231. // Connection to the printer control resources                                                     */
  232. type gxDeviceCommunicationsType
  233. {
  234.     switch 
  235.         {
  236.         case Serial:
  237.             key unsigned longint='SPTL';                                                                /* Communications type identifier */
  238.         
  239.             integer                        baud300 = 380, baud600 = 189, baud1200 = 94, baud1800 = 62, /* Output baud rate */
  240.                                             baud2400 = 46, baud3600 = 30, baud4800 = 22, baud7200 = 14, 
  241.                                             baud9600 = 10, baud19200 = 4, baud38400 = 2, baud57600 = 0;
  242.             integer                        noParity = 0, oddParity = 4096, evenParity = 12288;            /* Output parity */
  243.             integer                        oneStop = 16384, oneFiveStop = -32768, twoStop = -16384;        /* Output stop bits */
  244.             integer                        data5 = 0, data6 = 2048, data7 = 1024, data8 = 3072;            /* Output data bits */
  245.             unsigned hex longint;                                                                        /* Output handshaking high word */
  246.             unsigned hex longint;                                                                        /* Output handshaking low word */
  247.             integer                        baud300 = 380, baud600 = 189, baud1200 = 94, baud1800 = 62, /* Input baud rate */
  248.                                             baud2400 = 46, baud3600 = 30, baud4800 = 22, baud7200 = 14, 
  249.                                             baud9600 = 10, baud19200 = 4, baud38400 = 2, baud57600 = 0;
  250.             integer                        noParity = 0, oddParity = 4096, evenParity = 12288;            /* Input parity */
  251.             integer                        oneStop = 16384, oneFiveStop = -32768, twoStop = -16384;        /* Input stop bits */
  252.             integer                        data5 = 0, data6 = 2048, data7 = 1024, data8 = 3072;            /* Input data bits */
  253.             unsigned hex longint;                                                                        /* Input handshaking high word */
  254.             unsigned hex longint;                                                                        /* Input handshaking low word */
  255.             integer;                                                                                            /* Serial input buffer size */
  256.             pstring[63];                                                                                    /* Input port name */
  257.             pstring[63];                                                                                    /* Output port name */
  258.             
  259.         case PAP:
  260.             key unsigned longint='PPTL';        /* Communications type identifier */
  261.             integer;                                    /* Flow quantum */
  262.             string[99];                                /* Compacted AppleTalk name of printer */
  263.             fill byte;
  264.             longint;                                    /* future use - must be nil */
  265.             longint;                                    /* future use - must be nil */
  266.             longint;                                    /* future use - must be nil */
  267.             longint;                                    /* Most recent network address of the printer */
  268.             
  269.         case SCSI:
  270.             key unsigned longint='sPTL';        /* Communications type identifier */
  271.             longint;                                    /* future use - must be nil */
  272.             integer;                                    /* SCSI I/O attributes applicable to data transfers*/
  273.             longint;                                    /* future use - must be nil */
  274.             integer;                                    /* SCSI bus number where device is located. 0 = motherboard */
  275.             integer;                                    /* SCSI device number of device. */
  276.             longint;                                    /* 0 => ignored; > 0 => break data transfer into chunks of this size */
  277.                                                         /* (at SCSI TIB level) */
  278.             longint;                                    /* future use - must be nil */
  279.             integer;                                    /* deviceType to look for */
  280.             integer;                                    /* minimum amount of data in the response */
  281.             integer;                                    /* offset from start to look in the response data */
  282.             pstring;                                    /* string to look for in the response data */
  283.             
  284.         case PrinterShare:
  285.             key unsigned longint='ptsr';        /* Communications type identifier */
  286.             string[99];                                /* Compacted AppleTalk name of server */
  287.             fill byte;
  288.             longint;                                    /* Most recent network address of the printer */
  289.  
  290.         case NotConnected:
  291.             key unsigned longint='nops';        /* Communications type identifier */
  292.         };
  293. };
  294.  
  295.  
  296. // This resource controls the behavior of the standard buffering and IO
  297. // within the Printing Manager.  If the specific driver does not include
  298. // such a resource, the system defaults to 2 buffers of 1K each,
  299. // and timeout values of 10 seconds each.  The specific driver can prevent
  300. // the system from doing buffering or IO by specifying the correct
  301. // values within this resource
  302. type gxUniversalIOPrefsType
  303. {
  304.     longint standardIO = 0x00000000, customIO = 0x00000001;
  305.     
  306.     longint;        // number of buffers to allocate, 0 = none
  307.     longint;        // size of each buffer
  308.     longint;        // number of IO requests that can be pending at any one time
  309.     longint;        // open/close timeout in ticks
  310.     longint;        // read/write timeout in ticks
  311. };
  312.  
  313.  
  314. // A driver may supply 3 capture strings which are used to capture PAP devices.
  315. //     captureStringID                - string used for capture/uncapture (no length byte)
  316. //     uncapturedAppleTalkType    - AppleTalk type used for uncaptured devices (w/ length byte)
  317. //     capturedAppleTalkType        - AppleTalk type used for captured devices (w/ length byte)
  318. // The default implementation performs string substitution on the capture string
  319. // prior to sending it to the device, and the following strings are defined:
  320. //  PRINTERNAME    - name of the printer 
  321. //     PRINTERTYPE    - type of the printer 
  322. //     NAMELEN    - name length byte
  323. //     TYPELEN - type length byte
  324.  
  325. type gxCaptureType {
  326.         string;                                                /* String                */
  327. };
  328.  
  329.  
  330.  
  331. // RASTER RELATED RESOURCES
  332.  
  333. // This resource specifies the imaging preferences for raster drivers.
  334. // Many common drivers can simply specify their imaging preferences via this resource.
  335. #define gxNoColorPacking        0x0000
  336. #define gxAlphaSpace            0x0080
  337. #define gxWord5ColorPacking        0x0500
  338. #define gxLong8ColorPacking        0x0800
  339. #define gxLong10ColorPacking    0x0a00
  340. #define gxAlphaFirstPacking        0x1000
  341.  
  342. #define gxNoSpace                    0
  343.  
  344. #define gxRGBSpace                1
  345. #define gxCMYKSpace                2
  346. #define gxHSVSpace                3
  347. #define gxHLSSpace                4
  348.  
  349. #define gxYXYSpace                5
  350. #define gxXYZSpace                6
  351. #define gxLUVSpace                7
  352. #define gxLABSpace                8
  353.  
  354. #define gxYIQSpace                9
  355. #define gxNTSCSpace                gxYIQSpace
  356. #define gxPALSpace                gxYIQSpace
  357.  
  358. #define gxGraySpace                10
  359. #define gxIndexedSpace            11
  360.  
  361. #define gxRGBASpace                gxRGBSpace + gxAlphaSpace
  362. #define gxGrayASpace            gxGraySpace + gxAlphaSpace
  363. #define gxRGB16Space               gxWord5ColorPacking + gxRGBSpace
  364. #define gxRGB32Space              gxLong8ColorPacking + gxRGBSpace
  365. #define gxARGB32Space              gxLong8ColorPacking + gxAlphaFirstPacking + gxRGBASpace
  366. #define gxCMYK32Space              gxLong8ColorPacking + gxCMYKSpace
  367. #define gxHSV32Space               gxLong10ColorPacking + gxHSVSpace
  368. #define gxHLS32Space               gxLong10ColorPacking + gxHLSSpace
  369. #define gxYXY32Space               gxLong10ColorPacking + gxYXYSpace
  370. #define gxXYZ32Space               gxLong10ColorPacking + gxXYZSpace
  371. #define gxLUV32Space              gxLong10ColorPacking + gxLUVSpace
  372. #define gxLAB32Space              gxLong10ColorPacking + gxLABSpace
  373. #define gxYIQ32Space              gxLong10ColorPacking + gxYIQSpace
  374. #define gxNTSC32Space             gxYIQ32Space
  375. #define gxPAL32Space              gxYIQ32Space
  376.  
  377. type gxRasterPrefsType
  378. {
  379.     longint     gxDefaultRaster = 0,                                // default options
  380.                 gxDontResolveTransferModes       = 0x01,                // 0=Resolve, 1=Don't Resolve
  381.                 gxRenderInReverse                  = 0x02,                // traverse image in reverse order
  382.                 gxOnePlaneAtATime                = 0x04,                // render each plane separately
  383.                 gxSendAllBands                    = 0x08;                // send even white bands
  384.  
  385.                                                             // both of these are fixed point numbers
  386.     longint;                                                // horizontal resolution to image at
  387.     longint;                                                // vertical resolution to image at
  388.     
  389.     integer;                                                // min band size
  390.     integer;                                                 // max band size
  391.     
  392.     longint;                                                // RAM percentage
  393.     longint;                                                // RAM slop
  394.     
  395.     integer;                                                // depth of imaging, in pixels per plane
  396.     integer = $$CountOf(PlaneArray);
  397.     array PlaneArray 
  398.         {
  399.         // plane flags
  400.         longint gxDefaultOffscreen = 0,
  401.                 gxDontSetHalftone = 1,
  402.                 gxDotTypeIsDitherLevel = 2;
  403.                     
  404.         // HALFTONE STRUCTURE
  405.         hex longint;                                    // fixed point angle
  406.         hex longint;                                    // fixed point frequency
  407.         
  408.         longint gxRoundDot = 1, gxSpiralDot = 2,     // type of dither
  409.             gxSquareDot = 3, gxLineDot = 4, gxEllipticDot = 5, 
  410.             gxTriangleDot = 6, gxDispersedDot = 7, gxCustomDot = 8;
  411.         longint                                             // tintType
  412.             gxLuminanceTint = 1, gxAverageTint = 2, gxMixtureTint = 3, 
  413.             gxComponent1Tint = 4, gxComponent2Tint = 5, gxComponent3Tint = 6, gxComponent4Tint = 7;
  414.         
  415.         longint;                                            // dot color
  416.         longint gxNoProfile = 0;                                            
  417.         hex integer;
  418.         hex integer;
  419.         hex integer;
  420.         hex integer;
  421.         
  422.         longint;                                            // background color
  423.         longint gxNoProfile = 0;                                            
  424.         hex integer;
  425.         hex integer;
  426.         hex integer;
  427.         hex integer;
  428.  
  429.         longint;                                            // tintSpace
  430.         
  431.         // OTHER PLANE FLAGS
  432.         longint;                                            // plane colorSpace, can be gxNoSpace
  433.         longint gxNoSet = 0;                                    // plane color set resource ID
  434.         longint gxNoProfile = 0;                                // plane color profile resource ID
  435.         };
  436. };
  437.  
  438. // The custom halftone resource allows the driver to specify a matrix to use
  439. // for halftoning.
  440. type gxCustomMatrixType
  441. {
  442.         hex longint;                                    // fixed point dpiX
  443.         hex longint;                                    // fixed point dpiY
  444.         longint;                                        // width
  445.         longint;                                        // height
  446.         longint;                                        // tile shift
  447.         array samples
  448.             {
  449.             hex integer;
  450.             };
  451. };
  452.  
  453. // The raster packaging resource controls how your driver uses the default
  454. // RasterDataIn message.  If you implement this message yourself, you should
  455. // not have this resource.  If you use the default RasterDataIn message,
  456. // you MUST have a resource of this type
  457. #define gxSendAllColors        0x00000001
  458. #define gxInterlaceColor    0x00000002
  459. #define gxOverlayColor        0x00000004
  460.  
  461. type gxRasterPackType
  462. {
  463.     longint;            // buffer size for packaging (>= maximum head pass size)
  464.     integer;            // iColorPasses :1 or 4 is typical
  465.     integer;            // iHeadHeight  :Printhead height in pixels
  466.     integer;            // iNumberPasses :number of head passes it takes to == iHeadHeight
  467.     integer;            // iPassOffset : offset between passes, in pixels
  468.     hex longint;    // flags
  469. }; 
  470.  
  471.  
  472. // This resource controls the remaining 2 raster packaging messages: RasterLineFeed,
  473. // and RasterPackageBitmap.  If you allow the generic driver to implement these messages for
  474. // you then you MUST have a resource of this type. 
  475.  
  476. type gxRasterPackOptionsType
  477. {
  478.     integer;        // start page wstring ID
  479.     integer;        // form feed wstring ID
  480.     
  481.     // forward line feed
  482.     integer;        // max value
  483.     integer;        // numberType
  484.     integer;        // minWidth
  485.     char;            // pad char
  486.     fill byte;
  487.     pstring[31];    // prefix string        
  488.     pstring[31];    // postfix string
  489.     
  490.     // reverse line feed
  491.     integer;        // max value
  492.     integer;        // numberType
  493.     integer;        // minWidth
  494.     char;            // pad char
  495.     fill byte;
  496.     pstring[31];    // prefix string
  497.     pstring[31];    // postfix string
  498.     
  499. };
  500.  
  501.  
  502. // For specifying a colorSet.
  503.  
  504. type gxColorSetResType {
  505.     longint;                            // colorSpace for the colorSet
  506.     longint = $$CountOf(colorSet);
  507.     array colorSet                         // members of the colorSet
  508.         {
  509.         hex integer;    
  510.         hex integer;
  511.         hex integer;
  512.         hex integer;
  513.         };
  514. };
  515.  
  516.  
  517.  
  518. // POSTSCRIPT IMAGING RESOURCES
  519.  
  520. // resource for PostScript procedure set control resource
  521.  
  522. // these types are for the second integer in the array
  523.  
  524. #define donothing            0
  525. #define dumpwidestring        1
  526. #define dumpstringlist        2
  527. #define converttohex        0x0100
  528.  
  529. type gxPostscriptProcSetControlType    {
  530.  
  531.         pstring;                                         // procset name
  532.         align word;
  533.         hex longint;                                // procset version -- type( Fixed )
  534.         integer;                                        // revision
  535.         longint;                                        // vm usage
  536.         
  537.         integer = $$Countof(IDArray);                // Number of resources that make up the data set.
  538.  
  539.             wide array IDArray {
  540.                 
  541.                 integer;                                // ID of the resource containing the data.
  542.                 integer;                                // the flags are defined above
  543.  
  544.             };
  545.     };
  546.  
  547.  
  548. type gxPostscriptPrinterFontType {
  549.  
  550.     longint        ROMFont = 0;                // memory usage
  551.     
  552.     switch        {
  553.         case    AdobeCharacterSet:            // a font with the adobe character set
  554.             key hex longint = 0x00000000;
  555.         
  556.         case    AppleCharacterSet:
  557.             key hex longint = 0x00010000;    // a font with some of the glyph in the apple std set
  558.             glyphbits:
  559.                 longint        glyphcount;        // the max number of the glyph in the array
  560.                 hex string [ ( ( $$Long( glyphbits ) + 7 ) / 8 ) ];
  561.                 align long;
  562.     
  563.         case    EquivalentFont:                // a font with all equivalent glyphs on the mac
  564.             key hex longint = 0x00020000;
  565.     
  566.         case    EncodedFont:                // a font that must be used as encoded
  567.             key hex longint = 0x00030000;
  568.                 longint;                    // platform
  569.                 longint;                    // script
  570.                 longint;                    // language
  571.     };
  572. };
  573.  
  574. // the following defines are used for the flags fields in the PostScriptPrefs data structure
  575.  
  576. #define gxNeedsHex                    1
  577. #define gxNeedsComments                2
  578. #define gxBoundingBoxesOption        4
  579. #define gxPortablePostScript        8
  580. #define gxTextClipsToPath            16
  581. #define gxFlattenClipPath            32
  582. #define gxUsercharpath1                64
  583. #define gxUseLevel2Color            128
  584. #define gxNoEPSIllegalOperators        256
  585. #define gxEPSTargetOption            gxNoEPSIllegalOperators + gxBoundingBoxesOption + gxNeedsComments
  586.  
  587. // the following define is for the fontType field in the PostScriptPrefs data structure
  588. // it should parallel the enumeration for "streamType" inside the file "scaler types.h"
  589.  
  590. #define    truetypeStreamType        0x0001
  591. #define    type1StreamType            0x0002
  592. #define    type3StreamType            0x0004
  593. #define    type42StreamType        0x0008
  594. #define    type42GXStreamType        0x0010
  595. #define    portableStreamType        0x0020
  596. #define    flattenedStreamType        0x0040
  597.  
  598. type gxPostscriptPrefsType    {
  599.  
  600.         integer;            // language Level;
  601.         longint;            // the color space for the device
  602.         longint;            // render Options;
  603.  
  604.         longint;            // pathLimit;
  605.         integer;            // gsaveLimit;
  606.         integer;            // opStackLimit;
  607.         longint;            // FontTypes;
  608.  
  609.         longint;            // printerVM;
  610. };
  611.  
  612.  
  613. // the following is the definition for the default scanning resource for postscript imaging system
  614.  
  615. #define StringScan    switch    {                    \
  616.             case SimpleScan:                    \
  617.                 key integer = 0;                \
  618.                         wstring;                \
  619.                         align word;                \
  620.             case UserNameScan:                    \
  621.                 key integer = 1;                \
  622.             case DocumentNameScan:                \
  623.                 key integer = 2;                \
  624.             case PrinterNameScan:                \
  625.                 key integer = 3;                \
  626.             case NilPtrScan:                    \
  627.                 key integer = 4;                \
  628.                 integer    length;                    \
  629.         }
  630.         
  631. #define    OffsetScan    switch    {                    \
  632.             case SimpleOffset:                    \
  633.                 key integer = 0;                \
  634.             case SameAsPreviousOffset:            \
  635.                 key integer = 1;                \
  636.             case ReturnedOffset:                \
  637.                 key integer = 2;                \
  638.             case SimpleRepeat:                    \
  639.                 key integer = 16;                \
  640.             case SampleAsPreviousRepeat:        \
  641.                 key integer = 17;                \
  642.             case ReturnedRepeat:                \
  643.                 key integer = 18;                \
  644.         }
  645.         
  646. #define    ActionScan    switch    {                    \
  647.             case NoAction:                        \
  648.                 key integer = 0;                \
  649.             case SimpleAction:                    \
  650.                 key integer = 1;                \
  651.                 integer    normal = 0,                \
  652.                         nonFatalError,            \
  653.                         fatalError;                \
  654.                 integer    alertID;                \
  655.         }
  656.  
  657. type gxPostscriptScanningType        {
  658.  
  659.     longint ownerCount;
  660.     
  661.     array    { 
  662.                 StringScan;
  663.                 StringScan;
  664.                 OffsetScan;
  665.                 ActionScan;
  666.             };
  667. };
  668.  
  669. // PAPER TYPE ('ptyp') DEFINITION AND CONSTANTS    
  670.  
  671. // Version of the 'ptyp' resource definition
  672.  
  673. #define        gxPaperTypeVersion    0x00010000    // Version 1.0
  674.  
  675.  
  676. // Miscellaneous types used by the 'ptyp' definition
  677.  
  678. #define        fixed            hex longint
  679. #define        gxRectangle        fixed; /* left */ fixed; /* top */ fixed; /* right */ fixed; /* bottom */
  680.  
  681.  
  682. // 'ptyp' - definition of a paper type resource
  683.  
  684. type gxPaperTypeType {
  685.     pstring;                                // paper type name
  686.     align word;
  687.     gxRectangle;                            // page rectangle
  688.     gxRectangle;                            // paper rectangle
  689.     longint        unknownBase        =    0,        // base paper type from which this paper type is
  690.                 usLetterBase    =    1,        // derived.  This is not a complete set.
  691.                 usLegalBase        =    2,
  692.                 a4LetterBase    =    3,
  693.                 b5LetterBase    =    4,
  694.                 tabloidBase        =    5;
  695.     literal longint;                        // creator
  696.     byte            pica    =    0,            // Unit of measure
  697.                     mm        =    1,
  698.                     inch    =    2;
  699.     unsigned bitstring[2]    newStylePaperType        =    1,    // Flags
  700.                             oldStylePaperType        =    2,
  701.                             oldAndNewStylePaperType    =    3;
  702.     unsigned bitstring[1]    = 0;                    
  703.     boolean        notDefaultPaperType        =    false,
  704.                 isDefaultPaperType        =    true;
  705.     unsigned bitstring[20] = 0;                        // Reserved flags
  706.     
  707.     longint = $$CountOf(ItemArray);                    // embedded collection
  708.     array ItemArray
  709.         {
  710.         longint;        //    tag;
  711.         longint;        //    id;
  712.             boolean        itemUnlocked            =    false,    // defined attributes bits...
  713.                         itemLocked                =    true;
  714.             boolean        itemNonPersistent        =    false,
  715.                         itemPersistent            =    true;
  716.             unsigned bitstring[14] = 0;                        // reserved attributes bits...
  717.             unsigned bitstring[16];                // user attributes bits...
  718.         wstring;
  719.         align word;
  720.     };
  721. };
  722.  
  723. // STATUS RELATED RESOURCES
  724.  
  725. type gxStatusType {
  726.     longint;                                    // status Owner
  727.     array statarray {
  728.         INTEGER        nonFatalError = 1, 
  729.                     fatalError = 2, 
  730.                     printerReady = 3, 
  731.                     userAttention = 4, 
  732.                     userAlert = 5, 
  733.                     pageTransmission = 6, 
  734.                     openConnectionStatus = 7,
  735.                     informationalStatus = 8,
  736.                     spoolingPageStatus = 9,
  737.                     endStatus = 10,
  738.                     percentageStatus = 11;
  739.                     
  740.         INTEGER;                                // statusId;
  741.         INTEGER;                                // statusAlertId;
  742.         pstring;                                 // statusMessage;
  743.         align word;
  744.         };
  745.     };
  746.     
  747.  
  748. // DIALOG RELATED RESOURCES
  749.  
  750. #define        xdtlRadioButtons        0
  751. #define        xdtlCheckBox            1
  752. #define        xdtlEditTextInteger        2
  753. #define        xdtlEditTextReal        3
  754. #define        xdtlEditTextString        4
  755. #define        xdtlPopUp                5
  756.  
  757.  
  758. type gxPrintPanelType {
  759.     pstring[31];            // the panel name
  760.     integer Script;            // script id
  761.     fill     word;            // reserve a long word for future use of international
  762.     fill     word;            // reserve a long word for future use of international
  763.     integer;                // the icon id
  764.     integer;                // the ditl id
  765. };
  766.  
  767. type gxExtendedDITLType {
  768.     integer = $$CountOf(xdtlarray) -1;
  769.     wide array xdtlarray {
  770.         switch {
  771.             case RadioButtons:
  772.                 key        integer = xdtlRadioButtons;
  773.                 literal    longint;        // 4 byte id for storage in job or format
  774.                         longint;        // numerical id for storage in job or format
  775.                         integer;        // offset in bytes into tag item
  776.                         integer = $$CountOf(RadioButtonsArray) - 1;
  777.                         wide array RadioButtonsArray
  778.                         {
  779.                             byte;        // array of corresponding items
  780.                         };
  781.             case CheckBox:
  782.                 key        integer = xdtlCheckBox;
  783.                 literal    longint;        // 4 byte id for storage in job or format
  784.                         longint;        // numerical id for storage in job or format
  785.                         integer;        // offset in bytes into tag item
  786.                         byte;            // corresponding ditl item
  787.                         fill byte;
  788.                                     
  789.             case EditTextInteger:
  790.                 key        integer = xdtlEditTextInteger;
  791.                 literal    longint;            // 4 byte id for storage in job or format
  792.                             longint;        // numerical id for storage in job or format
  793.                             integer;        // offset in bytes into tag item
  794.                             byte;            // corresponding ditl item
  795.                             byte;            // 0 = dont select, 1 = select
  796.                             pstring[15];    // low bound - nil means 'I don't care'
  797.                             pstring[15];    // high bound - nil means 'I don't care'
  798.  
  799.             case EditTextReal:
  800.                 key        integer = xdtlEditTextReal;
  801.                 literal    longint;            // 4 byte id for storage in job or format
  802.                             longint;        // numerical id for storage in job or format
  803.                             integer;        // offset in bytes into tag item
  804.                             byte;            // corresponding ditl item
  805.                             byte;            // 0 = dont select, 1 = select
  806.                             pstring[15];    // low bound - nil means 'I don't care'
  807.                             pstring[15];    // high bound - nil means 'I don't care'
  808.  
  809.             case EditTextString:
  810.                 key        integer = xdtlEditTextString;
  811.                 literal    longint;        // 4 byte id for storage in job or format
  812.                         longint;        // numerical id for storage in job or format
  813.                         integer;        // offset in bytes into tag item
  814.                         byte;            // corresponding ditl item
  815.                         byte;            // 0 = dont select, 1 = select
  816.  
  817.             case PopUp:
  818.                 key        integer = xdtlPopUp;
  819.                 literal    longint;        // 4 byte id for storage in job or format
  820.                         longint;        // numerical id for storage in job or format
  821.                         integer;        // offset in bytes into tag item
  822.                         byte;            // corresponding ditl item 
  823.                         fill byte;
  824.             };
  825.             align word;
  826.         };
  827.     };
  828.     
  829. // Printing ALERT RELATED RESOURCES 'plrt'
  830.  
  831. type gxPrintingAlertType {
  832.     integer        printingAlert = 1, printingStatus = 2;                                            // printing alert version
  833.     integer     noIcon = -1, stopIcon = 0, noteIcon = 1, cautionIcon = 2;                        // icon id
  834.     integer     defaultSystemSize = 0;                                                            // text size
  835.     byte        noDefaultTitle = 0, defaultAction = 1, defaultTitle2 = 2, defaultTitle3 = 3;    // default button
  836.     byte        noCancelTitle = 0, cancelAction = 1, cancelTitle2 = 2, cancelTitle3 = 3;        // cancel button
  837.     wstring;                                                                                    // text string
  838.     pstring;                                                                                    // action button label
  839.     pstring;                                                                                    // button label 2
  840.     pstring;                                                                                    // button label 3
  841.     pstring;                                                                                    // font name
  842.     pstring        AlertTitle = "Alert";                                                            // alert title
  843.     };
  844.  
  845.  
  846. // DESKTOP CONFIGURATION FILE RELATED RESOURCES
  847.  
  848. // driver resource to specify the tray name
  849.  
  850. type gxTrayNameDataType {                    // tray name data type ('tryn')
  851.     pstring[31];
  852. };
  853.  
  854.  
  855. // driver resource to specify the tray count
  856.  
  857. type gxTrayCountDataType {
  858.     longint;                            // count of trays
  859. };
  860.  
  861.  
  862. // Desktop printer resource to specify manual feed alert preferences. ('mfpr')
  863.  
  864. #define gxShowAlerts            0x00000001    // Enable manual feed alerts (default).
  865. #define gxAlertOnPaperChange    0x00000002    // …but only if the papertype changes.
  866.  
  867. type gxManualFeedAlertPrefsType {
  868.     unsigned bitstring[16];    // flags -- for driver's private use.
  869.     unsigned bitstring[16];    // flags -- predefined. gxShowAlerts, gxShowAlerts +gxAlertOnPaperChange, or 0.
  870. };
  871.  
  872.  
  873. // Desktop printer resource to specify whether or not this desktop printer has trays. ('outp')
  874.  
  875. #define gxCanConfigureTrays        0x00000001    // Can configure trays for this printer.
  876.  
  877. type gxDriverOutputType {
  878.     longint;                // flags -- for driver's private use.
  879.     longint;                // flags -- predefined. Currently, gxCanConfigureTrays or 0.
  880. };
  881.  
  882.  
  883.  
  884. type gxDITLControlType{
  885.     integer;                                /*  DTILsize Maximum item count for DITL */
  886.     
  887.     integer = $$CountOf(dctlarray) - 1;        /* Array size */
  888.     wide array dctlarray {
  889.         switch {
  890.  
  891.         case Button:
  892.             key integer     = 1;
  893.                 integer;                    /* Item ID that this is the button of */
  894.                 integer                            /* Button kind */
  895.                     cancel    = 0;    
  896.         case Cluster:
  897.             key integer     = 2;
  898.             integer                            /* What kind of cluster is this? */
  899.                 feed        = 0,
  900.                 quality        = 1,
  901.                 coverPage    = 2,
  902.                 firstPage    = 3,
  903.                 restPage    = 4,
  904.                 headMotion    = 5,
  905.                 createFile    = 6,
  906.                 user0        = 7,
  907.                 user1        = 8,
  908.                 user2        = 9;
  909.                 
  910.             integer = $$CountOf(ClusterArray) - 1;
  911.                 wide array ClusterArray
  912.                     {
  913.                     integer;            /* The item ID this corresponds to */
  914.                     };
  915.  
  916.         case Copies:
  917.             key integer = 3;
  918.                 integer;                /* ID of the item */
  919.                 
  920.         case DialogBtn:
  921.             key integer = 4;
  922.                 integer;                /* Item ID of the cascade button */
  923.                 integer;                /* ID of the dialog */
  924.                 integer;                /* ID of the dctl for the dialog */
  925.  
  926.         case Frill:
  927.             key integer = 5;        
  928.                 integer;                /* Item ID of this frill */
  929.                 integer                        /* What kind of frill might this be? */
  930.                     line         = 0,
  931.                     version        = 1,
  932.                     default        = 2,
  933.                     printerName    = 3,
  934.                     grayBoxLine = 4;
  935.  
  936.         case Moof:
  937.             key integer = 6;
  938.                 integer;                /* ID of the Moof∞™ */
  939.                 
  940.         case OKButton:
  941.             key integer = 7;
  942.                 integer;                /* Item ID of the OK button */
  943.                 integer;                /* ID of the "Print" string */
  944.                 integer;                /* ID of the "Save" string */
  945.  
  946.         case Orientation:
  947.             key integer = 8;    
  948.                 integer;            /* ID of portrait orientation */
  949.                 integer;        /* ID of the landscape orientation */
  950.                 integer;        /* ID of flipped portrait */
  951.                 integer;        /* ID of the flipped landscape */
  952.  
  953.         case PageRange:
  954.             key integer = 9;
  955.                 integer;                /* ID of the "all" button */
  956.                 integer;            /* ID of the range button */
  957.                 integer;                /* ID of the from edit text */
  958.                 integer;                /* ID of the to edit text */
  959.                 
  960.         case PaperSizes:
  961.             key integer = 10;
  962.             integer;        /* Item of the popup */
  963.             integer;            /* Item of the popup radio button */
  964.             fill long;
  965.             fill word;
  966.                         
  967.             integer = $$CountOf(ClusterArray) - 1;
  968.                 wide array ClusterArray
  969.                     {
  970.                     integer;            /* The item ID this corresponds to */
  971.                     };
  972.                     
  973.         case Scale:
  974.             key integer = 11;
  975.                     integer;            /* Item ID of the edit text */
  976.                     integer;            /* Item ID of the arrow useritem */
  977.                     integer;            /* resource ID for the 'stab' resource */
  978.         case Toggle:
  979.             key integer = 12;
  980.             integer;                    /* Item ID that this coresponds to */
  981.             integer                        /* Value to OR into flags to set it */
  982.                 bPreciseBitmap         = $0001,
  983.                 bBiggerPages        = $0002,
  984.                 bGraphicSmoothing    = $0004,
  985.                 bTextSmoothing        = $0008,
  986.                 bFontSubstitution    = $0010,
  987.                 bInvert                = $0020,
  988.                 bFlipHoriz            = $0040,
  989.                 bFlipVert            = $0080,
  990.                 bColorMode            = $0100,
  991.                 bBidirectional        = $0200,
  992.                 bUser0                = $0400,
  993.                 bUser1                = $0800,
  994.                 bUser2                = $1000,
  995.                 bReserved0            = $2000,
  996.                 bReserved1            = $4000,
  997.                 bReserved2            = $8000;
  998.         
  999.         case PopUp:
  1000.             key integer = 13;
  1001.             integer                            /* What kind of PopUp is this? */
  1002.                 N_Up        = -1,
  1003.                 feed        = 0,
  1004.                 quality        = 1,
  1005.                 coverPage    = 2,
  1006.                 firstPage    = 3,
  1007.                 restPage    = 4,
  1008.                 headMotion    = 5,
  1009.                 createFile    = 6,
  1010.                 user0        = 7,
  1011.                 user1        = 8,
  1012.                 user2        = 9;
  1013.             integer;                        /* id of control */            
  1014.         };
  1015.     align word;                                /* Each item is word aligned */
  1016.     };
  1017. };
  1018.  
  1019.  
  1020. type gxScaleTableType {                    /* definition for values in reduction table -    */
  1021.                                 /*  NOTE - VALUES EXPECTED IN ASCENDING ORDER      */
  1022.     integer = $$Countof(valarray);
  1023.     array valarray {
  1024.         integer;
  1025.         };
  1026.     };
  1027.  
  1028. #endif
  1029.